package com.apexsoft.test.sample.ams.controller;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.apexsoft.test.sample.ams.consumer.AmsClientDemo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AmsClientController {

    @Autowired
    AmsClientDemo amsClientDemo;

    @RequestMapping("grpcSay")
    public JSONObject grpcSay(){
        return amsClientDemo.grpcSay();

    }

    @RequestMapping("test")
    public JSONObject test(){

        return (JSONObject) JSONObject.toJSON(amsClientDemo.aServiceCall());

    }
}
